/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.sistemas.ceiebt.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Davis
 */
public class UsuarioForm extends org.apache.struts.action.ActionForm {
    
private String usuario;
private String pwd;

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getUsuario() {
        return usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }

    public ActionErrors validate(ActionMapping mapping,HttpServletRequest request ){
        ActionErrors errors = new ActionErrors();
        if(usuario.length()<= 0){
            errors.add("usu",new ActionMessage("errors.usuario"));
        }else{
            if(pwd.length()<=0){
                errors.add("pwd",new ActionMessage("errors.clave"));
            }
        }
        mapping.getInputForward();
        return errors;

    }

}
